home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00374_Media Display.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  9.6 KB  |  340 lines

  1. global gthumbn1spr, gthumbn2spr, gthumbn3spr, gthumbn4spr, gthumbn5spr, gthumbholdcst, gVideoButtspr, gAudioButtspr, gResrcButtspr, gpictholdcst, gGlobalStepCount, gmediafile1, gmediafile2, gmediafile3, gmediafile4, gmediafile5, gPDL, gthevideofile, gVideoName, gAudioName, gResourceName, gcurrentmedialist, gNewWin, gActiveResTopWin, gOnOffSwitch, gAssetPath, gInputField, gPhotoSND, gTopicLocList, gTopIsPaused, gActiveTopWin, gPiconGarage, gNumofpicons, gPiconcastloc, gModeState, gQTSprite, gTopicBase, gthumbnRefspr, oINTERfaceTopicControl, oWinKey, oTopicControl, oVidCD, gTopicIsText, gStylingNeedF, gNormalVidButtCast, gSwapCDVidButtCast
  2.  
  3. on hInitThumbholders
  4.   set gthumbnRefspr to 41
  5.   set gthumbn1spr to 42
  6.   set gthumbn2spr to 43
  7.   set gthumbn3spr to 44
  8.   set gthumbn4spr to 45
  9.   set gthumbn5spr to 46
  10.   set gVideoButtspr to 17
  11.   set gAudioButtspr to 8
  12.   set gthumbholdcst to the number of cast "thumbnail placeholder"
  13.   set gNormalVidButtCast to the number of cast "video"
  14.   set gSwapCDVidButtCast to the number of cast "Video clip on CD button"
  15. end
  16.  
  17. on hSetupThumbs
  18.   puppetSprite(gthumbn1spr, 1)
  19.   puppetSprite(gthumbn2spr, 1)
  20.   puppetSprite(gthumbn3spr, 1)
  21.   puppetSprite(gthumbn4spr, 1)
  22.   puppetSprite(gthumbn5spr, 1)
  23.   set the castNum of sprite gthumbn1spr to gthumbholdcst
  24.   set the castNum of sprite gthumbn2spr to gthumbholdcst
  25.   set the castNum of sprite gthumbn3spr to gthumbholdcst
  26.   set the castNum of sprite gthumbn4spr to gthumbholdcst
  27.   set the castNum of sprite gthumbn5spr to gthumbholdcst
  28.   updateStage()
  29.   set gmediafile1 to EMPTY
  30.   set gmediafile2 to EMPTY
  31.   set gmediafile3 to EMPTY
  32.   set gmediafile4 to EMPTY
  33.   set gmediafile5 to EMPTY
  34. end
  35.  
  36. on hPurgeMedia
  37.   hUpdateWin()
  38.   hSetupThumbs()
  39.   hResetMediaButts()
  40.   mClearCDNum(oVidCD)
  41. end
  42.  
  43. on hPurgeMediaHprocessCHRO
  44.   hUpdateWin()
  45.   hResetMediaButts()
  46.   mClearCDNum(oVidCD)
  47. end
  48.  
  49. on hPurgeMediaCHRO
  50.   hUpdateWin()
  51.   hSetupThumbs()
  52. end
  53.  
  54. on hResetMediaButts
  55.   puppetSprite(gVideoButtspr, 0)
  56.   puppetSprite(gAudioButtspr, 0)
  57.   go(the frame)
  58. end
  59.  
  60. on hDisplayPicons
  61.   hearit(gPhotoSND)
  62.   if gNumofpicons = 1 then
  63.     set the castNum of sprite gthumbn1spr to getAt(gPiconcastloc, 1)
  64.     hHideOpenPicons()
  65.     updateStage()
  66.   else
  67.     set the castNum of sprite gthumbn1spr to getAt(gPiconcastloc, 1)
  68.     repeat with i = 1 to gNumofpicons - 1
  69.       set the castNum of sprite (gthumbn1spr + i) to getAt(gPiconcastloc, 1 + i)
  70.     end repeat
  71.     hHideOpenPicons()
  72.     updateStage()
  73.   end if
  74. end
  75.  
  76. on hFetchMedia
  77.   if count(gcurrentmedialist) > 0 then
  78.     set gNumofpicons to getAt(gcurrentmedialist, 1)
  79.     set gPiconcastloc to getAt(gcurrentmedialist, 2)
  80.     set LQTshortnm to getAt(gcurrentmedialist, 4)
  81.     set Laudioflag to getAt(gcurrentmedialist, 5)
  82.     if gNumofpicons = 0 then
  83.       nothing()
  84.     else
  85.       hDisplayPicons()
  86.     end if
  87.     if LQTshortnm <> 0 then
  88.       mEvaluateVidPlay(oVidCD, LQTshortnm)
  89.     else
  90.       nothing()
  91.     end if
  92.     if Laudioflag <> 0 then
  93.       hShowAudButton(Laudioflag)
  94.     else
  95.       nothing()
  96.     end if
  97.   else
  98.     hReportStatus("This is a text-only entry.")
  99.   end if
  100. end
  101.  
  102. on hShowVidButton LQTflag
  103.   hReportStatus("There's a Video Clip for this entry.")
  104.   puppetSprite(gVideoButtspr, 1)
  105.   set the castNum of sprite gVideoButtspr to gNormalVidButtCast
  106.   set the locH of sprite gVideoButtspr to 34
  107.   set the locV of sprite gVideoButtspr to 316
  108.   updateStage()
  109.   set gVideoName to LQTflag
  110. end
  111.  
  112. on hShowAltVidButton pQTshortnm
  113.   hReportStatus("There's a Video Clip for this entry on another CD.")
  114.   puppetSprite(gVideoButtspr, 1)
  115.   set the castNum of sprite gVideoButtspr to gSwapCDVidButtCast
  116.   set the locH of sprite gVideoButtspr to 34
  117.   set the locV of sprite gVideoButtspr to 316
  118.   updateStage()
  119.   set gVideoName to pQTshortnm
  120. end
  121.  
  122. on hShowAudButton Laudioflag
  123.   hReportStatus("There's an Audio Clip for this entry.")
  124.   puppetSprite(gAudioButtspr, 1)
  125.   set the locH of sprite gAudioButtspr to 34
  126.   set the locV of sprite gAudioButtspr to 349
  127.   updateStage()
  128.   set gAudioName to Laudioflag
  129. end
  130.  
  131. on hFetchResMedia
  132.   global gCurrentResAttrib, gAssetPath, gFirstChar, gPlaying, gPlayAll, oVidCD, gNewWin, gComputerTypeK
  133.   hHideThumbs()
  134.   hStopPicManQT()
  135.   if mCheckForHomeCD(oVidCD, "hFetchResMedia") then
  136.     if getAt(gCurrentResAttrib, 1) = 1 then
  137.       if not voidp(gActiveResTopWin) then
  138.         forget(window gActiveResTopWin)
  139.       end if
  140.       set the fileName of cast the number of cast "BlankM.DIR" to the pathName & "BL" & gPDL & "BlankM.DIR"
  141.       set the fileName of cast "BlankM.dir" to gAssetPath & gFirstChar & gPDL & getAt(gCurrentResAttrib, 2) & "1M.DXR"
  142.       hRestoreLockWins()
  143.     else
  144.       hStoreLockWins()
  145.       hHideThumbs()
  146.       if the fileName of cast the number of cast "BlankM.DIR" <> (the pathName & "BL" & gPDL & "BlankM.DIR") then
  147.         set the fileName of cast the number of cast "BlankM.DIR" to the pathName & "BL" & gPDL & "BlankM.DIR"
  148.       end if
  149.       if not voidp(gActiveResTopWin) then
  150.         forget(window gActiveResTopWin)
  151.       end if
  152.       set gFirstChar to char 1 of string(getAt(gCurrentResAttrib, 2))
  153.       if gComputerTypeK = #WIN then
  154.         set gNewWin to gAssetPath & gFirstChar & gPDL & getAt(gCurrentResAttrib, 2) & "1W.dir"
  155.       else
  156.         set gNewWin to gAssetPath & gFirstChar & gPDL & getAt(gCurrentResAttrib, 2) & "1M.dir"
  157.       end if
  158.       set the windowType of window gNewWin to 2
  159.       set theSL to the stageLeft
  160.       set theST to the stageTop
  161.       set thewinht to 319
  162.       set thewinwd to 563
  163.       set offSetL to theSL + 77
  164.       set offSetT to theST + (480 - 319)
  165.       set theRect to rect(offSetL, offSetT, thewinwd + offSetL, thewinht + offSetT)
  166.       set the rect of window gNewWin to theRect
  167.       open(window gNewWin)
  168.       set gActiveResTopWin to gNewWin
  169.       tell window gNewWin
  170.         mSetbasicWinKeys(oWinKey, window gNewWin)
  171.       end tell
  172.     end if
  173.   end if
  174. end
  175.  
  176. on hFetchTopicMedia Pthesearchtext
  177.   global gCurrentTopicAttrib, gAssetPath, gFirstChar, oVidCD, gNewWin
  178.   hHideThumbs()
  179.   if not voidp(gActiveResTopWin) then
  180.     if string(the windowList) contains gActiveResTopWin then
  181.       hCloseTopWin()
  182.       forget(window gActiveResTopWin)
  183.     end if
  184.   end if
  185.   if count(gCurrentTopicAttrib) = 1 then
  186.     if mCheckForHomeCD(oVidCD, "hFetchTopicMedia" & Pthesearchtext) then
  187.       set gTopicIsText to 0
  188.       set gNewWin to gAssetPath & getAt(gCurrentTopicAttrib, 1) & gPDL & getAt(gCurrentTopicAttrib, 1) & "1M.dir"
  189.       set the windowType of window gNewWin to 2
  190.       set theSL to the stageLeft
  191.       set theST to the stageTop
  192.       set thewinht to 304
  193.       set thewinwd to 563
  194.       set offSetL to theSL + 77
  195.       set offSetT to theST + (480 - 304)
  196.       set theRect to rect(offSetL, offSetT, thewinwd + offSetL, thewinht + offSetT)
  197.       set the rect of window gNewWin to theRect
  198.       open(window gNewWin)
  199.       set gActiveResTopWin to gNewWin
  200.       set the visible of sprite gTopicBase to 1
  201.       hResumeTopWin()
  202.       mForceTopHlt(oINTERfaceTopicControl, 1)
  203.       tell window gNewWin
  204.         mSetbasicWinKeys(oWinKey, window gNewWin)
  205.       end tell
  206.       set the visible of sprite gTopicBase to 1
  207.       hResumeTopWin()
  208.       mForceTopHlt(oINTERfaceTopicControl, 1)
  209.       set gStylingNeedF to 1
  210.     end if
  211.   else
  212.     set gTopicIsText to 1
  213.     set gStylingNeedF to 1
  214.     mHideTopicVisibles(oTopicControl)
  215.     set the visible of sprite gTopicBase to 0
  216.     hTextEntryProcess(Pthesearchtext)
  217.   end if
  218. end
  219.  
  220. on hPauseTopWin
  221.   hStoreTopLocation()
  222.   tell window gActiveResTopWin
  223.     go(marker(0))
  224.   end tell
  225.   tell window gActiveResTopWin
  226.     hStopTopQT()
  227.   end tell
  228.   set gTopIsPaused to 1
  229. end
  230.  
  231. on hRewindTopWin
  232.   tell window gActiveResTopWin
  233.     hStopTopQT()
  234.   end tell
  235.   tell window gActiveResTopWin
  236.     set x to line 1 of the labelList
  237.   end tell
  238.   tell window gActiveResTopWin
  239.     go(label(x))
  240.   end tell
  241.   tell window gActiveResTopWin
  242.     InitTopicText(oTopicControl)
  243.   end tell
  244.   hStoreTopLocation()
  245. end
  246.  
  247. on hResumeTopWin
  248.   set vFrametoJump to getaProp(gTopicLocList, gActiveResTopWin)
  249.   if not voidp(vFrametoJump) then
  250.     tell window gActiveResTopWin
  251.       go(vFrametoJump)
  252.     end tell
  253.   end if
  254.   tell window gActiveResTopWin
  255.     hStartTopQT()
  256.   end tell
  257.   set gTopIsPaused to 0
  258. end
  259.  
  260. on hCloseTopWin
  261.   hshutup()
  262.   tell window gActiveResTopWin
  263.     hshutup()
  264.   end tell
  265.   hStoreTopLocation()
  266.   tell window gActiveResTopWin
  267.     hStopTopQT()
  268.   end tell
  269.   set gTopIsPaused to 0
  270.   mHideTopicVisibles(oTopicControl)
  271. end
  272.  
  273. on hshutup
  274.   puppetSound(0)
  275.   sound stop 1
  276.   sound stop 2
  277. end
  278.  
  279. on hStoreTopLocation
  280.   tell window gActiveResTopWin
  281.     set vTopPauseFrame to marker(0)
  282.   end tell
  283.   setaProp(gTopicLocList, gActiveResTopWin, vTopPauseFrame)
  284. end
  285.  
  286. on hStopTopQT
  287.   set x to the castNum of sprite gQTSprite
  288.   if x > 0 then
  289.     if the castType of cast x = #digitalVideo then
  290.       set the movieRate of sprite gQTSprite to 0
  291.       updateStage()
  292.     end if
  293.   end if
  294. end
  295.  
  296. on hStartTopQT
  297.   set x to the castNum of sprite gQTSprite
  298.   if x > 0 then
  299.     if the castType of cast x = #digitalVideo then
  300.       set the movieRate of sprite gQTSprite to 1
  301.       updateStage()
  302.     end if
  303.   end if
  304. end
  305.  
  306. on hOpenAudio
  307.   global oVidCD
  308.   if gOnOffSwitch = 1 then
  309.     sound stop 2
  310.     set gOnOffSwitch to 0
  311.   else
  312.     if mCheckForHomeCD(oVidCD, "hOpenAudio") then
  313.       set gFirstChar to char 1 of string(gAudioName)
  314.       sound playFile 2, gAssetPath & gFirstChar & gPDL & gAudioName
  315.       set gOnOffSwitch to 1
  316.     end if
  317.   end if
  318. end
  319.  
  320. on hShowResource
  321.   hSetMode(#Resources)
  322.   put string(gResourceName) into field gInputField
  323.   hilite char 999 of field gInputField
  324.   hMiniFind()
  325. end
  326.  
  327. on hStopPicManQT
  328.   global gPlaying, gPlayAll, gActiveResTopWin
  329.   if gPlaying = 1 then
  330.     tell window gActiveResTopWin
  331.       hstopPicardmovie()
  332.     end tell
  333.   end if
  334.   if gPlayAll = 1 then
  335.     tell window gActiveResTopWin
  336.       hstopPicardmovie()
  337.     end tell
  338.   end if
  339. end
  340.